/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.topic.conversation.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.zx.topic.conversation.entity.TtopicOfConversation;
import com.jeesite.modules.zx.topic.conversation.dao.TtopicOfConversationDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 社群管理Service
 * @author zpp
 * @version 2020-02-03
 */
@Service
@Transactional(readOnly=true)
public class TtopicOfConversationService extends CrudService<TtopicOfConversationDao, TtopicOfConversation> {
	
	/**
	 * 获取单条数据
	 * @param ttopicOfConversation
	 * @return
	 */
	@Override
	public TtopicOfConversation get(TtopicOfConversation ttopicOfConversation) {
		return super.get(ttopicOfConversation);
	}
	
	/**
	 * 查询分页数据
	 * @param ttopicOfConversation 查询条件
	 * @param ttopicOfConversation.page 分页对象
	 * @return
	 */
	@Override
	public Page<TtopicOfConversation> findPage(TtopicOfConversation ttopicOfConversation) {
		return super.findPage(ttopicOfConversation);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param ttopicOfConversation
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(TtopicOfConversation ttopicOfConversation) {
		super.save(ttopicOfConversation);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(ttopicOfConversation.getId(), "ttopicOfConversation_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(ttopicOfConversation.getId(), "ttopicOfConversation_file");
	}
	
	/**
	 * 更新状态
	 * @param ttopicOfConversation
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(TtopicOfConversation ttopicOfConversation) {
		super.updateStatus(ttopicOfConversation);
	}
	
	/**
	 * 删除数据
	 * @param ttopicOfConversation
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(TtopicOfConversation ttopicOfConversation) {
		super.delete(ttopicOfConversation);
	}
	
}